package couk.mmtdigital.sm.model
{
	import org.puremvc.as3.interfaces.IProxy;
	import org.puremvc.as3.patterns.proxy.Proxy;

	public class FileListProxy extends Proxy implements IProxy
	{
		public static const NAME:String = "FileListProxy";
		
		private var _fileList:Array;
		private var _fileXML:Array;
		private var _path:String;
		private var _currentFolder:String = "";
		
		public function FileListProxy(data:Object=null){
			super(NAME, data);
			
		}
		
		public function set fileList(fL:Array):void{ 
			_fileList = fL; 
			_fileList.sortOn("type", Array.NUMERIC);
			for(var i:int = 0; i < _fileList.length; i++){
				trace("File at "+i+": "+_fileList[i]['name']);
			}
		}
		public function set path(p:String):void{ _path = p; }
		public function set fileXML(a:Array):void{ _fileXML = a }
		public function set currentFile(f:String):void{ _currentFolder = f; trace("currentFolder: "+_currentFolder);}
		
		public function get fileList():Array{ return _fileList; }
		public function get path():String{ return _path; }
		public function get fileXML():Array{ return _fileXML; }
		public function get currentFile():String{ return _currentFolder; }
		
		/* public function getFileVO(n:Number):FileVO{
			var tempVO:
			if(n < _fileList.length)
				return _fileList[n];
		} */
	}
}